package login;

//Data Encapsulation using Getters and Setters

import application.Seed;
import java.util.HashMap;

/**
 * Represents a user in the SeedSwap system
 * @author The Freds
 */
public class User {
	private String username;
	private String password; 
	private String firstName; 
	private String lastName;
        private String climateZone;
        private String city;
        private String state;
        private String street1;
        private String street2;
        private String zip;
        private String interests;
        private String registrationStatus;
        private String email;
        private boolean valid; 
        private boolean locked;
        private boolean admin;
        private int consecutiveFails;
        private int ID;
        
        /**
         * Constructor
         * @param uname
         * @param password
         */
        public User(String uname, String password){
            this.username = uname;
            this.password = password;
            valid = false;
        }
        /**
         * Constructor
         * @param uname
         * @param password
         * @param firstName
         * @param lastName
         * @param email
         * @param climateZone
         * @param street1
         * @param street2
         * @param city
         * @param state
         * @param zip
         * @param interests
         */
        public User(String uname, String password, String firstName,String lastName, String email, String climateZone, String street1, 
                String street2, String city,String state, String zip, String interests){
            this.username = uname;
            this.password = password;
            this.firstName = firstName; 
            this.lastName = lastName;
            this.climateZone = climateZone;
            this.city = city;
            this.state = state;
            this.street1 = street1;
            this.street2 = street2;
            this.zip = zip;
            this.interests = interests;
            this.email =email;
            valid = false;
            locked=false;
            admin = false;
            consecutiveFails=0;
            registrationStatus = "Successfully Registered";
        }
        /**
         * 
         * @return the last name
         */
        public String getFirstName()
	{ 
		return firstName; 
	} 
        /**
         * Sets the first name
         * @param newFirstName
         */
        public void setFirstName(String newFirstName)
	{
		firstName = newFirstName; 
	} 
        /**
         *
         * @return the last name
         */
        public String getLastName() 
	{ 
		return lastName; 
	} 
        /**
         * 
         * @param newLastName
         */
        public void setLastName(String newLastName) 
	{ 
		lastName = newLastName; 
	} 
        /**
         * 
         * @return the password
         */
        public String getPassword() 
	{ 
		return password; 
	} 
        /**
         * Sets the password
         * @param newPassword
         */
        public void setPassword(String newPassword)
	{ 
		password = newPassword; 
	}
        /**
         * 
         * @return the username
         */
        public String getUsername() 
	{ 
		return username; 
	}
        /**
         * Sets the username
         * @param newUsername
         */
        public void setUsername(String newUsername) 
	{ 
		username = newUsername; 
	} 
        /**
         * 
         * @return a boolean whether the user is valid
         */
        public boolean isValid()
	{ 
		return valid; 
	} 
        /**
         * Set whether the user is valid or not
         * @param newValid
         */
        public void setValid(boolean newValid)
	{
		valid = newValid; 
	} 
        
        /**
        * @param status sets registrationStatus
        */
        public void setRegistrationStatus(String status){
            registrationStatus = status;
        }
        
        /**
        * @return registration status
        */
        public String getRegistrationStatus(){
            return registrationStatus;
        }
        
        /**
        * @return climate zone
        */
        public String getClimateZone(){
            return climateZone;
        }
        
        /**
        * @param s sets climateZone
        */
        public void setClimateZone(String s){
            climateZone = s;
        }
        
        /**
        * @return street1 (line 1) of address
        */
        public String getStreet1(){
            return street1;
        }
        
        /**
        * @param s sets street1
        */
        public void setStreet1(String s){
            street1 = s;
        }
        
        /**
        * @return street2 (line 2) of address
        */
        public String getStreet2(){
            return street2;
        }
        
        /**
        * @param s sets street2
        */
        public void setStreet2(String s){
            street2 = s;
        }
        
        /**
        * @return city name
        */
        public String getCity(){
            return city;
        }
        
        /**
        * @param s sets city
        */
        public void setCity(String s){
            city = s;
        }
        
        /**
        * @return state name 
        */
        public String getState(){
            return state;
        }
        
        /**
        * @param s sets state 
        */
        public void setState(String s){
            state = s;
        }
        
        /**
        * @return zip
        */
        public String getZip(){
            return zip;
        }
        
        /**
        * @param s sets zip
        */
        public void setZip(String s){
            zip = s;
        }
        
        /**
        * @param s sets email
        */
        public void setEmail(String s){
            email = s;
        }
        
        /**
        * @return email
        */
        public String getEmail(){
            return email;
        }
        
        /**
        * @return interests
        */
        public String getInterests(){
            return interests;
        }
        
        /**
        * @param interests sets interests
        */
        public void setInterests(String interests){
            this.interests = interests;
        }
        
        /**
         * @param con 
         * @para con sets locked
        */
        public void setLocked(boolean con){
            locked = con;
        }
        
        /**
        * @return locked status
        */
        public boolean isLocked(){
            return locked;
        }
        
        /**
        * increments consecutiveFails
        */
        public void addFail(){
            consecutiveFails++;
        }
        
        /**
        * @return consecutiveFails
        */
        public int getFails(){
            return consecutiveFails;
        }
        /**
        * @param i is what the conscecutiveFals is set to
        */
        public void setFails(int i){
            consecutiveFails = i;
        }
        
        /**
        * @return the ID
        */
        public boolean isAdmin(){
            return admin;
        }
        /**
        * @param con the Admin to true/false
        */
        public void setIsAdmin(boolean con){
            admin = con;
        }
    /**
     * @return the ID
     */
    public int getID() {
        return ID;
    }

    /**
     * @param ID the ID to set
     */
    public void setID(int ID) {
        this.ID = ID;
    }
}
